package net.cyan.proteus.execute;

import net.cyan.proteus.base.*;
import net.cyan.proteus.base.logic.*;
import net.cyan.proteus.execute.logic.*;

/**
 * 
 * @author camel
 * @date 2008-6-28
 */
public class BaseTemplateExecutor extends TemplateExecutor
{
    public BaseTemplateExecutor()
    {
        addElementExecutor(ElElement.class, new ElExecutor());
        addElementExecutor(TagElement.class, new TagExecutor());
        addElementExecutor(SegmentElement.class, new SegmentExecutor());

        LogicExecutor logicExecutor = new LogicExecutor();
        logicExecutor.addStatementExecutor(IfStatement.class, new IfExecutor());
        logicExecutor.addStatementExecutor(ForStatement.class, new ForExecutor());
        logicExecutor.addStatementExecutor(WhileStatement.class, new WhileExecutor());
        logicExecutor.addStatementExecutor(AssignStatement.class, new AssignExecutor());
        logicExecutor.addStatementExecutor(BreakStatement.class, new BreakExecutor());
        logicExecutor.addStatementExecutor(ContinueStatement.class, new ContinueExecutor());
        addElementExecutor(LogicElement.class, logicExecutor);
        addElementExecutor(MacroElement.class, new MacroExecutor());

        addElementExecutor(MacroCallElement.class, new MacroCallExecutor());
        addElementExecutor(NestedElement.class, new NestedExecutor());

        addElementExecutor(ScriptElement.class, new ScriptExecutor());
    }
}
